# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

$ ->
  $('[data-toggle="tooltip"]').tooltip()

  $(".rating input:radio").attr("checked", false)
  $('.rating input').click ->
    el = $(@)
    el.parents('.star-wrap').find("span").removeClass('checked')
    el.parent().addClass('checked')

  $("#qrcode").hover (e)->
    $(@).animate
      right: "0"
    ,500
    $(@).find('.handle').fadeOut()
    e.stopPropagation()
  , (e)->
    $(@).animate
      right: "-200px"
    ,500
    $(@).find('.handle').fadeIn()
    e.stopPropagation()